package com.huanying.goodjob.job;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.huanying.framework.user.User;
//222
@Entity
@Table(name = "jobitem_user")
public class Jobitem_User implements Serializable{

	private static final long serialVersionUID = -7111487971755182212L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;
	
	@ManyToOne(cascade = CascadeType.ALL, optional = true, fetch = FetchType.LAZY)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "user_id")
	private User user; // 接单人
	
	@ManyToOne(cascade = CascadeType.ALL, optional = true, fetch = FetchType.LAZY)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "jobitem_id")
	private Jobitem jobitem; // 工作项
	
	private Date create_time;  // 接单时间
	
	@Column(name = "jobitem_status", nullable = false, columnDefinition = "INT default 0")
	private int jobitem_status; // 接单状态
	//0.初始态 1.选中 2.未选中	
	
	@Column(name = "rework_status", nullable = false, columnDefinition = "INT default 0")
	private int rework_status; // 接单状态
	
	@Column(name = "status", nullable = false, columnDefinition = "INT default 1")
	private int status; // 状态

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Jobitem getJobitem() {
		return jobitem;
	}

	public void setJobitem(Jobitem jobitem) {
		this.jobitem = jobitem;
	}

	public Date getCreate_time() {
		return create_time;
	}

	public void setCreate_time(Date create_time) {
		this.create_time = create_time;
	}

	public int getJobitem_status() {
		return jobitem_status;
	}

	public void setJobitem_status(int jobitem_status) {
		this.jobitem_status = jobitem_status;
	}

	public int getRework_status() {
		return rework_status;
	}

	public void setRework_status(int rework_status) {
		this.rework_status = rework_status;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
	
}
